// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import router from "./router";
import "@assets/css/index.css";

// 将自动注册所有组件为全局组件
import dataV from "@jiaminghi/data-view";
Vue.use(dataV);

//ant组件
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.less";
Vue.use(Antd);

//外部字体
import "./assets/css/font.css";
//天气字体
import "@assets/css/iconfont.css";

// Viewer引入
import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";
Vue.use(Viewer);
Viewer.setDefaults({
  // // 需要配置的属性 注意属性并没有引号
  // title: false,
  // toolbar: false
});

Vue.config.productionTip = false;

let configUrl = "/static/config/view.json";

fetch(configUrl)
  .then(res => res.json())
  .then(res => {
    //将配置文件里面的参数,全部挂载到vue上面,这个在其他地方,就可以用this去获取了
    Vue.prototype["$view"] = { ...res };
  });

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  components: { App },
  template: "<App/>"
});
